will always be compiled into Xen.
Signed-off-by: Keir Fraser <keir@xensource.com>
}
#endif
-#ifdef CONFIG_SVM
start_svm();
-#endif
}
static unsigned int amd_size_cache(struct cpuinfo_x86 * c, unsigned int size)
if (c->x86 == 6)
set_bit(X86_FEATURE_P3, c->x86_capability);
-#ifdef CONFIG_VMX
start_vmx();
-#endif
}
#include <asm/hvm/svm/vmcb.h>
#include <asm/hvm/svm/emulate.h>
-#ifdef CONFIG_SVM
-
extern int inst_copy_from_guest(unsigned char *buf, unsigned long guest_eip,
int inst_len);
"eip = %lx\n", __func__, (unsigned long)vmcb->rip);
return 0;
}
-#endif /* CONFIG_SVM */
/*
* Local variables:
#define DPRINTF DPRINTK
#include <asm-x86/x86_emulate.h>
-#ifdef CONFIG_SVM
/*
* Opcode effective-address decode tables.
* Note that we only emulate instructions that have at least one memory
svm_dump_inst(_regs.eip);
return (unsigned long)-1;
}
-#endif /* CONFIG_SVM */
#include <public/hvm/ioreq.h>
#include <xen/domain_page.h>
-#ifdef CONFIG_SVM
-
/*
* Most of this code is copied from vmx_io.c and modified
* to be suitable for SVM.
}
}
-#endif /* CONFIG_SVM */
-
/*
* Local variables:
* mode: C
#include <public/sched.h>
#include <public/hvm/ioreq.h>
-#ifdef CONFIG_SVM
-
#define SVM_EXTRA_DEBUG
#ifdef TRACE_BUFFER
}
clear_bit(ARCH_SVM_VMCB_ASSIGN_ASID, &v->arch.hvm_svm.flags);
}
-#endif /* CONFIG_SVM */
/*
* Local variables:
#include <xen/kernel.h>
#include <xen/domain_page.h>
-#ifdef CONFIG_SVM
-
extern int svm_dbg_on;
extern int asidpool_assign_next( struct vmcb_struct *vmcb, int retire_current,
int oldcore, int newcore);
svm_dump_sel("IDTR", &vmcb->idtr);
svm_dump_sel("TR", &vmcb->tr);
}
-#endif /* CONFIG_SVM */
/*
* Local variables:
popl %eax; \
addl $(NR_SKIPPED_REGS*4), %esp
-#ifdef CONFIG_SVM
-
ALIGN
#define VMRUN .byte 0x0F,0x01,0xD8
sti
call do_softirq
jmp svm_test_all_events
-#endif /* CONFIG_SVM */
-
popq %rdi; \
addq $(NR_SKIPPED_REGS*8), %rsp; \
-#ifdef CONFIG_SVM
#define VMRUN .byte 0x0F,0x01,0xD8
#define VMLOAD .byte 0x0F,0x01,0xDA
#define VMSAVE .byte 0x0F,0x01,0xDB
sti
call do_softirq
jmp svm_test_all_events
-#endif /* CONFIG_SVM */
-
#include <asm/hvm/vlapic.h>
#include <public/hvm/ioreq.h>
-#ifdef CONFIG_VMX
-
#define BSP_CPU(v) (!(v->vcpu_id))
void vmx_set_tsc_shift(struct vcpu *v, struct hvm_virpit *vpit)
/* We can't resume the guest if we're waiting on I/O */
ASSERT(!test_bit(ARCH_HVM_IO_WAIT, &v->arch.hvm_vcpu.ioflags));
}
-#endif /* CONFIG_VMX */
/*
* Local variables:
#include <asm/shadow_64.h>
#endif
-#ifdef CONFIG_VMX
-
int vmcs_size;
struct vmcs_struct *alloc_vmcs(void)
vmx_do_launch(v);
reset_stack_and_jump(vmx_asm_do_launch);
}
-#endif /* CONFIG_VMX */
/*
* Local variables:
#include <asm/hvm/vpic.h>
#include <asm/hvm/vlapic.h>
-
-#ifdef CONFIG_VMX
-
static unsigned long trace_values[NR_CPUS][4];
#define TRACE_VMEXIT(index,value) trace_values[smp_processor_id()][index]=value
TRACE_3D(TRC_VMEXIT,0,0,0);
return;
}
-#endif /* CONFIG_VMX */
/*
* Local variables:
ALIGN
-#ifdef CONFIG_VMX
-
ENTRY(vmx_asm_vmexit_handler)
/* selectors are restored/saved by VMX */
HVM_SAVE_ALL_NOSEGREGS
ENTRY(vmx_asm_do_relaunch)
vmx_asm_common 1 1
-
-#endif /* CONFIG_VMX */
popq %rdi; \
addq $(NR_SKIPPED_REGS*8), %rsp; \
-#ifdef CONFIG_VMX
ENTRY(vmx_asm_vmexit_handler)
/* selectors are restored/saved by VMX */
HVM_SAVE_ALL_NOSEGREGS
ENTRY(vmx_asm_do_relaunch)
vmx_asm_common 1 1
-
-#endif /* CONFIG_VMX */
-
DEFINE(_VCPUF_nmi_masked, _VCPUF_nmi_masked);
BLANK();
-#ifdef CONFIG_SVM
OFFSET(VCPU_svm_vmcb_pa, struct vcpu, arch.hvm_svm.vmcb_pa);
OFFSET(VCPU_svm_hsa_pa, struct vcpu, arch.hvm_svm.host_save_pa);
OFFSET(VCPU_svm_vmcb, struct vcpu, arch.hvm_svm.vmcb);
OFFSET(VMCB_rax, struct vmcb_struct, rax);
OFFSET(VMCB_tsc_offset, struct vmcb_struct, tsc_offset);
BLANK();
-#endif
OFFSET(VCPUINFO_upcall_pending, vcpu_info_t, evtchn_upcall_pending);
OFFSET(VCPUINFO_upcall_mask, vcpu_info_t, evtchn_upcall_mask);
DEFINE(_VCPUF_nmi_masked, _VCPUF_nmi_masked);
BLANK();
-#ifdef CONFIG_SVM
OFFSET(VCPU_svm_vmcb_pa, struct vcpu, arch.hvm_svm.vmcb_pa);
OFFSET(VCPU_svm_hsa_pa, struct vcpu, arch.hvm_svm.host_save_pa);
OFFSET(VCPU_svm_vmcb, struct vcpu, arch.hvm_svm.vmcb);
OFFSET(VMCB_rax, struct vmcb_struct, rax);
OFFSET(VMCB_tsc_offset, struct vmcb_struct, tsc_offset);
BLANK();
-#endif
OFFSET(VCPUINFO_upcall_pending, vcpu_info_t, evtchn_upcall_pending);
OFFSET(VCPUINFO_upcall_mask, vcpu_info_t, evtchn_upcall_mask);
#define CONFIG_X86 1
#define CONFIG_X86_HT 1
#define CONFIG_SHADOW 1
-#define CONFIG_VMX 1
-#define CONFIG_SVM 1
#define CONFIG_SMP 1
#define CONFIG_X86_LOCAL_APIC 1
#define CONFIG_X86_GOOD_APIC 1
#ifndef __ASM_X86_HVM_SVM_EMULATE_H__
#define __ASM_X86_HVM_SVM_EMULATE_H__
-#ifdef CONFIG_SVM
-
typedef enum OPERATING_MODE_ {
INVALID_OPERATING_MODE = -1,
LEGACY_MODE,
vmcb->rip += inst_len;
}
-#endif /* CONFIG_SVM */
-
#endif /* __ASM_X86_HVM_SVM_EMULATE_H__ */
/*
#ifndef __ASM_X86_HVM_SVM_INTR_H__
#define __ASM_X86_HVM_SVM_INTR_H__
-#ifdef CONFIG_SVM
-
extern void svm_set_tsc_shift(struct vcpu *v, struct hvm_virpit *vpit);
extern void svm_intr_assist(void);
extern void svm_intr_assist_update(struct vcpu *v, int highest_vector);
extern void svm_intr_assist_test_valid(struct vcpu *v,
unsigned long *intr_result);
-#endif /* CONFIG_SVM */
-
#endif /* __ASM_X86_HVM_SVM_INTR_H__ */
#include <asm/hvm/svm/vmcb.h>
#include <asm/i387.h>
-#ifdef CONFIG_SVM
extern void asidpool_retire( struct vmcb_struct *vmcb, int core );
extern void svm_asm_vmexit_handler(struct cpu_user_regs);
#define SVM_REG_R14 (14)
#define SVM_REG_R15 (15)
-#endif /* CONFIG_SVM */
-
#endif /* __ASM_X86_HVM_SVM_H__ */
#include <asm/config.h>
#include <asm/hvm/hvm.h>
-#ifdef CONFIG_SVM
-
extern int start_svm(void);
/* general 1 intercepts */
#define VMCB_EFLAGS_RESERVED_0 0xffc08028 /* bitmap for 0 */
#define VMCB_EFLAGS_RESERVED_1 0x00000002 /* bitmap for 1 */
-#endif /* CONFIG_SVM */
-
#endif /* ASM_X86_HVM_SVM_VMCS_H__ */
/*
#ifndef __ASM_X86_HVM_SVM_VMMCALL_H__
#define __ASM_X86_HVM_SVM_VMMCALL_H__
-#ifdef CONFIG_SVM
-
/* VMMCALL command fields */
#define VMMCALL_CODE_CPL_MASK 0xC0000000
#define VMMCALL_CODE_MBZ_MASK 0x3FFF0000
return (cmd & VMMCALL_CODE_CPL_MASK) >> 30;
}
-#endif /* CONFIG_SVM */
-
#endif /* __ASM_X86_HVM_SVM_VMMCALL_H__ */
#include <asm/hvm/io.h>
#include <asm/hvm/vlapic.h>
-
-#ifdef CONFIG_VMX
#include <asm/hvm/vmx/vmcs.h>
-#endif
-#ifdef CONFIG_SVM
#include <asm/hvm/svm/vmcb.h>
-#endif
struct hvm_vcpu {
unsigned long ioflags;
struct vlapic *vlapic;
union {
-#ifdef CONFIG_VMX
struct arch_vmx_struct vmx;
-#endif
-#ifdef CONFIG_SVM
struct arch_svm_struct svm;
-#endif
} u;
};
#ifndef __ASM_X86_HVM_VMX_CPU_H__
#define __ASM_X86_HVM_VMX_CPU_H__
-#ifdef CONFIG_VMX
-
/*
* Virtual CPU
*/
#define VMX_MF_32 1
#define VMX_MF_64 2
-#endif /* CONFIG_VMX */
-
#endif /* __ASM_X86_HVM_VMX_CPU_H__ */
#include <asm/hvm/vmx/cpu.h>
#include <public/hvm/vmx_assist.h>
-#ifdef CONFIG_VMX
-
extern int start_vmx(void);
extern void stop_vmx(void);
HOST_RIP = 0x00006c16,
};
-#endif /* CONFIG_VMX */
-
#endif /* ASM_X86_HVM_VMX_VMCS_H__ */
/*
#include <asm/hvm/vmx/vmcs.h>
#include <asm/i387.h>
-#ifdef CONFIG_VMX
-
extern void vmx_asm_vmexit_handler(struct cpu_user_regs);
extern void vmx_asm_do_resume(void);
extern void vmx_asm_do_launch(void);
return 0;
}
-#endif /* CONFIG_VMX */
-
#endif /* __ASM_X86_HVM_VMX_VMX_H__ */